package com.shs.controller;

import com.shs.domain.CommonResult;
import com.shs.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 晚点再动心
 * @Date 2022/8/23
 */
@RestController
public class StorageController {
    @Autowired
    private StorageService storageService;
    //库存扣减
    @RequestMapping("/storage/decrease")
    public CommonResult decrease(Long productId,Integer count){
        storageService.decrease(productId,count);
        return new CommonResult(200,"扣减库存成功！");
    }
}

